import 'dart:io';

import 'package:fluro/fluro.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_ahj_app/base/utils/downloadfile/sp_util.dart';
import 'package:flutter_ahj_app/entry/EnvInit.dart';

import 'package:flutter_modular/flutter_modular.dart';

import 'app_module.dart';
import 'app_widget.dart';
import 'base/cunchu/UserInfoUtils.dart';
import 'base/utils/screen_util.dart';

Future<void> main() async {
  // EnvInit.initUri();
  WidgetsFlutterBinding.ensureInitialized();
  SystemChrome.setPreferredOrientations(
      [DeviceOrientation.portraitUp, DeviceOrientation.portraitDown]);
  // WidgetsFlutterBinding.ensureInitialized(); 
  await SpUtil.getInstance(); 
  await UserInfoUtils.getInstance();
  await  ScreenUtil.getInstance();



  //路由初始化代码
  // final router = FluroRouter();
  // Routes.configureRoutes(router);
  // Application.router = router;

  runApp(ModularApp(module: AppModule(), child:  AppWidget()));
 

  if (Platform.isAndroid) {
    SystemUiOverlayStyle systemUiOverlayStyle =
        SystemUiOverlayStyle(statusBarColor: Colors.transparent);
    SystemChrome.setSystemUIOverlayStyle(systemUiOverlayStyle);
  }
}

